﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Projektet.Model
{
    class GameModel
    {
        public HumanPlayer _humanPlayer;
        public NPCplayer _npcPlayer;
        private Combat.CombatHandler _combatHandler;

        public GameModel(EventListener eventListener, int levelCount) 
        {
            _humanPlayer = new HumanPlayer(PlayerType.Human, eventListener, new Vector2(0,0), levelCount);
            _npcPlayer = new NPCplayer(PlayerType.Npc, eventListener, new Vector2(200,0), new AiSpawnLogic(_humanPlayer._unitList), levelCount);
            _combatHandler = new Combat.CombatHandler();
        }

        public void Update(GameTime gameTime) 
        {
            _humanPlayer.Update(gameTime);
            _npcPlayer.Update(gameTime);
            _humanPlayer.SpecificUpdate(gameTime, _npcPlayer._unitList);
            _npcPlayer.SpecificUpdate(gameTime);

            _combatHandler.CheckForContact(_humanPlayer._unitList, _npcPlayer._unitList);
            _combatHandler.CheckForContact(_npcPlayer._unitList, _humanPlayer._unitList);
        }

    }
}
